import router from '@/router'
import store from '@/store'

router.beforeEach((to, from, next) => {
  if (to.path !== '/login' && to.path !== '/404' && to.path !== '/test') {
    if (store.getters.token) {
      next()
    } else {
      next('/login')
    }
  } else {
    next()
  }
})
